package com.resou.reader.mine.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Author: 萤火虫
 * E-mail:  Allensuns@163.com
 * Description:
 * CreateTime: 2019-03 -18
 **/
public class ViewPagerAdapter extends FragmentStatePagerAdapter {
    FragmentManager mFragmentManager;
    List<Fragment> fragmentLists;

    public ViewPagerAdapter(FragmentManager fm, List<Fragment> fragmentLists) {
        super(fm);
        this.mFragmentManager = fm;
        this.fragmentLists = fragmentLists;
    }

    @Override
    public Fragment getItem(int i) {
        return fragmentLists.get(i);
    }

    @Override
    public int getCount() {
        return fragmentLists == null ? 0 : fragmentLists.size();
    }
}
